#include "dialog.h"
#include <QLabel>
#include <QPushButton>
#include <QVBoxLayout>

Dialog::Dialog(QWidget* parent) : QDialog(parent)
{
    this->setAttribute(Qt::WA_DeleteOnClose);
    this->resize(300, 400);

    QLabel* label = new QLabel("这是一个对话框", this);
    QPushButton* button = new QPushButton("按钮", this);

    QVBoxLayout* layout = new QVBoxLayout();
    this->setLayout(layout);

    layout->addWidget(label);
    layout->addWidget(button);

    connect(button, &QPushButton::clicked, this, &Dialog::close);
}
